package com.example.databindingdemo;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import com.example.databindingdemo.databinding.ActivityLoginBinding;

/**
 *  测试双向绑定
 * @author: tuyrt7 on 2020/9/8.
 */
public class LoginActivity extends AppCompatActivity {

    private ActivityLoginBinding mBinding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_login);

        TwoWayBindingViewModel viewModel = new TwoWayBindingViewModel();
        mBinding.setViewModel(viewModel);
    }
}
